﻿<UserControl x:Class="Startup.Shell.Modules.PreviewDesignerCtrlModule.PreviewDesignerCtrlModule"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:PreviewDesignerCtrlModule="clr-namespace:Startup.Shell.Modules.PreviewDesignerCtrlModule"
             xmlns:Controls="clr-namespace:Startup.Shell.Controls"
             xmlns:FunctionalityContracts="clr-namespace:Startup.Shell.Domain.FunctionalityContracts" mc:Ignorable="d" d:DataContext="{x:Static PreviewDesignerCtrlModule:PreviewDesignerCtrlModelView.Designer}"
             d:DesignHeight="300" d:DesignWidth="300" AllowDrop="True">

	<UserControl.Resources>
		<BooleanToVisibilityConverter x:Key="booleanToVisibilityConverter"/>
	</UserControl.Resources>
	
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

		<Controls:CheckBoxList Visibility="{Binding ShowCommands, Converter={StaticResource booleanToVisibilityConverter}}"
							   AllItems="{x:Static FunctionalityContracts:FunctionalityContractsManager.Contracts}" CheckedItems="{Binding Commands}" />
		
		<Image Source="{Binding Image}" Visibility="{Binding ShowPreview, Converter={StaticResource booleanToVisibilityConverter}}" />

		<TextBlock Text="{Binding PropertyName}" Grid.Row="1" TextAlignment="Center"/>
    </Grid>
</UserControl>